<template>
<div>
    <div class="title">周末去哪儿</div>
    <ul>
        <li class="item" border-bottom v-for="item of list" :key="item.id">
            <div class="item-img-wrapper">
                <img class='item-img' :src="item.imgUrl">
            </div>
            <div class='item-info'>
                <p class='item-title'>{{item.title}}</p>
                <p class='item-text'>{{item.desc}}</p>
            </div>
        </li>
    </ul>
</div>
</template>

<script>
export default{
    name:'HomeWeekend',
    props:{
        list:Array
    }
}
</script>

<style scoped>
.title{
    margin-top:0.2rem;
    line-height: 0.8rem;
    background: #eee;
    text-indent:0.2rem;
}
.item-img-wrapper{
    height: 0;
    padding-bottom: 37.7%;
    overflow: hidden;
}
.item-img{
    width:100%;
}
.item-info{
    flex:1;
    padding: 0.2rem;
    /* 对于一个设置了flex:1的div容器，再对其设置min-width：0，,保证内容不超出外层容器 */
    min-width:0;
}
.item-title{
    line-height: 0,55rem;
    font-size: 0.32rem;
}
.item-text{
    line-height: 0.4rem;
    color: #616161;
    margin-top:0.1rem;
     /* 文字太长会出现... */
    overflow: hidden;
    white-space:nowrap;
    text-overflow: ellipsis;
}
</style>